<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/jsp/component/common.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title>专家结论修改</title>
    <meta charset="utf-8">
    <!-- Bootstrap Core CSS -->
    <link href="${css}/bootstrap.min.css" rel="stylesheet"/>
    <!-- bootstrapValidator验证 -->
    <link href="${assets}/bootstrapValidator/css/bootstrapValidator.css" rel="stylesheet"/>
</head>
<body style="width: 98%">
<form id="myForm" class="form-horizontal" method="post" >
    <input type="hidden" name="id" value="${testProjectItemConclusion.id}" />
    <div class="form-group">
        <label for="testItemCode" class="col-sm-2 control-label">项目名称</label>
        <div class="col-sm-10">
            <select id="testItemCode" name="testItemCode" class="form-control">
                <%--<option value="">请选择...</option>--%>
                <c:forEach items="${itemList}" var="item">
                    <option value="${item.testItemCode}" <c:if test="${item.testItemCode==testProjectItemConclusion.testItemCode}">selected="selected"</c:if> >${item.testItemName}</option>
                </c:forEach>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="conclusionName" class="col-sm-2 control-label">结论名称</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="conclusionName" name="conclusionName" value="${testProjectItemConclusion.conclusionName}"
                   placeholder="请输入结论名称">
        </div>
    </div>
    <div class="form-group">
        <label for="conclusionKind" class="col-sm-2 control-label">标准</label>
        <div class="col-sm-10">
            <select id="conclusionKind" name="conclusionKind" class="form-control">
                <option value="1" <c:if test="${testProjectItemConclusion.conclusionKind==1}">selected="selected"</c:if> >超高</option>
                <option value="2" <c:if test="${testProjectItemConclusion.conclusionKind==2}">selected="selected"</c:if> >超低</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="conclusionInfo" class="col-sm-2 control-label">结论</label>
        <div class="col-sm-10">
            <textarea class="form-control" id="conclusionInfo" name="conclusionInfo" rows="5" placeholder="请输入结论">${testProjectItemConclusion.conclusionInfo}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label for="fastCode" class="col-sm-2 control-label">速查代码</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="fastCode" name="fastCode" value="${testProjectItemConclusion.fastCode}"
                   placeholder="请输入速查代码">
        </div>
    </div>
    <div class="modal-footer" style="text-align: center ">
        <button type="button" class="btn btn-default" data-dismiss="modal" id="closeModalButt">关闭</button>
        <button type="submit" class="btn btn-primary">保存</button>
    </div>
</form>

<!-- jQuery -->
<script src="${js}/jquery-1.9.1.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="${js}/bootstrap.min.js"></script>

<script src="${js}/bootbox.js"></script>
<!-- bootstrapValidator验证 -->
<script src="${assets}/bootstrapValidator/js/bootstrapValidator.js"></script>
<!-- bootstrapValidator验证 国际化中文 -->
<script src="${assets}/bootstrapValidator/js/language/zh_CN.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
        $('#myForm').bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                testItemCode: {
                    validators: {
                        notEmpty: true
                    }
                },
                conclusionKind: {
                    validators: {
                        notEmpty: true
                    }
                },
                conclusionName: {
                    validators: {
                        notEmpty: true
                    }
                },
                conclusionInfo: {
                    validators: {
                        notEmpty: true
                    }
                }
            }
        }).on('success.form.bv', function (e) {
            e.preventDefault();
            $.ajax({
                url:'${URL_ADM_CONCLUSION_UPDATE}',
                type:'post',
                data:$('#myForm').serialize(),
                async : false, //默认为true 异步
                error:function(){
                    alert('error');
                },
                success:function(data){
                    window.parent.closeModal("update");
                }
            });
        });

        $("#closeModalButt").on("click",function(){
            window.parent.simpleCloseModal("update");
        });

    });

    <%--function doUpdate(){--%>
        <%--$.ajax({--%>
            <%--url:'${URL_ADM_CONCLUSION_UPDATE}',--%>
            <%--type:'post',--%>
            <%--data:$('#myForm').serialize(),--%>
            <%--async : false, //默认为true 异步--%>
            <%--error:function(){--%>
                <%--alert('error');--%>
            <%--},--%>
            <%--success:function(data){--%>
                <%--window.parent.closeModal("update");--%>
            <%--}--%>
        <%--});--%>
    <%--}--%>

</script>
</body>
</html>